\documentclass[11pt]{article}


\begin{document}  
  \noindent{\bf Name: \quad} Songggang Xu \\
  \noindent{\bf Email: \quad}sxu@tamu.edu \\

  \noindent{\bf Implementation by OpenMP}
  
  \begin{itemize}
    \item {\bf Algorithm} We use Pointer Jumping Method (PJM) to implement the prefix sum. Initially, we generate \emph{numints} integers randomly and parallelly and store them in the memory block \emph{memints}. Next, we divide all the integers into {\emph {nthreads}} groups, where {\emph {nthread} } is the number of processes. Each processes except the last one has the same number of integers. They compute the prefix sum in the memory block {\emph {memints}} in place by PJM. When the program halts, {\emph {memints}} contains the result of prefix sum of original integers. 

    \item {\bf Difference from MPI}
      The computation model is PRAM. By using the macro of ``\#pragma omp parallel'', the codes are committed simultaneously. There is no explicitly synchronization operations in program.
  \end{itemize}

  \noindent{\bf Implementation by MPI}
  
  \begin{itemize}
    \item {\bf Algorithm} We also use Pointer Jumping Technique to implement the prefix sum on MPI. We first initial the MPI environment and generate \emph{numints} integers. Second, we divide the integers into groups, each of which is to be processed by one node. On each node, we first compute the prefix sum sequentially. Second, we add the prefix sum from the predecessor and send the last element of sum to the successor. This message passing will generate the finally results of all the integers.

    \item {\bf Difference from OpenMP}
      MPI is a message passing computing environment. There are synchronizing technique, such as (MPI BARRIER, SEND, RECV), to coordinate the work between different nodes. Since the environment is built on network infrastructures, there are also some operations which are used to initialize or finalize the network. 

  \end{itemize}


\end{document}
